/*
 * Predictor2.h
 *
 *  Created on: Dec 4, 2014
 *      Author: ale
 */

#include <fstream>
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <string>
#include <map>
#include <cmath>
#include "UniHash.h"
#include <boost/tokenizer.hpp>
#include <sparsehash/sparse_hash_map>
using namespace std;

#ifndef PRED_PREDICTOR2_H_
#define PRED_PREDICTOR2_H_

class Predictor2 {
public:
	Predictor2();
	virtual ~Predictor2();

	bool agregarUnigrama(string uni, double prob, double boff);
	bool agregarBigrama(string bigrama, double prob, double boff);
	bool agregarTrigrama(string trigrama, double prob);

	long double obtenerProb(string ABC);

	/*Del primer termino necesito la probabilidad y del segundo el backoff*/
	long double obtenerProbTermUnigrama(string C, string B);
	long double obtenerProbTermBigrama(const char* A, const char* B, const char* C);
	long double obtenerProbTermTrigrama(const char* A, const char* B, const char* C);

private:
	google::sparse_hash_map<std::string, UniHash* > *unigramas;

};
#endif /* PRED_PREDICTOR2_H_ */
